package com.woniuxy.service.daily.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.dao.InsuranceMapper;
import com.woniuxy.pojo.Insurance;
import com.woniuxy.service.daily.InsuranceService;

@Service
public class InsuranceServiceImpl implements InsuranceService{

	@Autowired
	private InsuranceMapper insuranceMapper;
	
	@Override
	public PageInfo getAll(Integer pn,String condition) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pn, 5);
		List<Insurance> list=insuranceMapper.selectgetAll(condition);
		PageInfo pageInfo = new PageInfo(list,3);
		return pageInfo;

	}

	@Override
	public void insertSelective(Insurance in) {
		// TODO Auto-generated method stub
		insuranceMapper.insertSelective(in);
	}

	@Override
	public void deleteIn(Integer inId) {
		// TODO Auto-generated method stub
		insuranceMapper.deleteByPrimaryKey(inId);
	}

	@Override
	public void deleteIns(String inIds) {
		// TODO Auto-generated method stub
		insuranceMapper.deleteIns(inIds);
	}

	@Override
	public Insurance selectInById(Integer inIds) {
		// TODO Auto-generated method stub
		return insuranceMapper.selectByPrimaryKey(inIds);
	}

	@Override
	public void update(Insurance ins) {
		// TODO Auto-generated method stub
		insuranceMapper.updateByPrimaryKeySelective(ins);
	}

	@Override
	public List<Insurance> getAll() {
		// TODO Auto-generated method stub
		return insuranceMapper.getAll();
	}

}
